import { ARTICLE_CHANNELS_GET, ARTICLE_LIST } from '../constants'

const initState = {
  channels: [],
  articles: {},
}
export default function article(state = initState, action) {
  switch (action.type) {
    case ARTICLE_CHANNELS_GET:
      return {
        ...state,
        channels: action.payload,
      }
    case ARTICLE_LIST:
      return {
        ...state,
        articles: action.payload,
      }
    default:
      return state
  }
}
